import { DocsLayout } from "fumadocs-ui/layouts/docs";
import type { ReactNode } from "react";
import { baseOptions } from "@/app/layout.config";
import { source } from "@/lib/source";

export default async function Layout({
    params,
    children,
}: {
    params: Promise<{ lang: string }>;
    children: ReactNode;
}) {
    const { lang } = await params;

    return (
        <DocsLayout
            sidebar={{
                tabs: {
                    transform: (option, node) => ({
                        ...option,
                    }),
                },
            }}
            tree={source.pageTree[lang]}
            {...baseOptions}
        >
            {children}
        </DocsLayout>
    );
}
